package com.wyw.design.model.learning.behavioral.iteratorpattern;

/**
 * @Title   客户端
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * @Date 2023/4/18 10:09
 * Update History:
 * Author        Time            Content
 */
public class CLient {
    public static void main(String[] args) {
        // 定义聚族对象
        Aggregate aggregate = new ConcreteAggregate();
        aggregate.add("Java");
        aggregate.add("MySQL");
        aggregate.add("Spring");
        // 遍历
        Iterator iterator = aggregate.createIterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
